/**

 @Name: layuiSimpleNews - 极简新闻资讯模板
 @Author: star1029
 @Copyright

 */


layui.define(['element', 'form', 'laypage', 'upload', 'carousel'], function(exports){
    var $ = layui.$;

    var loadDictInfo = function(){
        $.ajax({
            cache : true,
            type : "GET",
            url : "/api/dict/list/constellation",
            async : false,
            error : function(request) {
                parent.layer.alert("Connection error");
            },
            success : function(data) {
                var dictList = $("#dictList");
                var innerHtml = "";
                $(data).each(function (index,item) {
                    innerHtml += "<div class='layui-col-xs3 layui-col-sm7 layui-col-md2' style='padding-top:5px;'>";
                    innerHtml += "<button type='button' class='layui-btn layui-btn-sm layui-btn-radius layui-btn'><a href='/f/wx/list/"+item['id']+"'>"+item['name']+"</a></button>";
                    innerHtml += "</div>";
                });
                dictList.html(innerHtml);
            }
        });
    };

    $(function(){
        //加载dict信息
        loadDictInfo();
    });
    exports('news', {});
})